/**
 * Created by Dalyn on 2017/3/22.
 */
import Relay from "react-relay";

export default class ApplyEnBalanceMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { applyEnBalance }`;
    }

    getVariables() {
        return {
            argsInput: {
                orderId: this.props.orderId,
                invoiceNum: this.props.invoiceNum,  //发票张数
                expressName: this.props.expressName,  //快递公司
                expressSheet: this.props.expressSheet,  //快递单号
                invoiceFileJson: this.props.invoiceFileJson,  //发票附件
                status: this.props.status
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on applyEnBalancePayload {
            data {
                errorCode
                value
                totalResult
                id
                enterpriseBalance{
                            orderId
                            partyAEnid
                            partyAEnName
                            partyBEnid
                            partyBEnName
                            loanMoney
                            loanInterest
                            remainAmount
                            status
                            applyTime
                            balanceTime
                            tranNo
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
                fragment on applyEnBalancePayload {
                    data {
                        errorCode
                        value
                        totalResult
                        id
                        enterpriseBalance{
                            orderId
                            partyAEnid
                            partyAEnName
                            partyBEnid
                            partyBEnName
                            loanMoney
                            loanInterest
                            remainAmount
                            status
                            applyTime
                            balanceTime
                            tranNo
                        }

                    }
                }
            `]
        }];
    }

}
